#include <iostream>
using namespace std;

void Teststring1()
{
  string s1("Hello World");
  string s2(s1);
  string s3 = "Hello Linux";
  cout<<s1.c_str()<<endl;//c_str()的作用是输出c格式的字符串，即遇到\0就停止
  cout<<s2<<endl;
  cout<<s3<<endl;
  cout<<s1.size()<<endl;
  cout<<s1.length()<<endl;
  cout<<s2.capacity()<<endl;
  s2.clear();
  cout<<s2<<endl;
  cout<<s2.size()<<endl;
  cout<<s2.capacity()<<endl;//Linux会把capacity清零，VS的编译器不会清

}
int main()
{
  Teststring1();
  
  return 0;
}
